package cn.edu.csmzxy.rk233x.auth_system.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
/**
 * @author wumxing
 * @date 2025/10/15 16:12
 * @description  权限 DTO
 */
@Data
@Schema(description = "权限请求参数")
public class PermissionDTO {

    @Schema(description = "权限名称", example = "部门管理")
    @NotBlank(message = "权限名称不能为空")
    @Size(max = 50, message = "权限名称长度不能超过50")
    private String name;

    @Schema(description = "权限编码", example = "dept:manage")
    @NotBlank(message = "权限编码不能为空")
    @Size(max = 100, message = "权限编码长度不能超过100")
    private String code;

    @Schema(description = "类型（1-菜单，2-按钮）", example = "1")
    @NotNull(message = "权限类型不能为空")
    private Integer type;

    @Schema(description = "访问路径", example = "/sys/dept")
    private String url;

    @Schema(description = "父权限ID", example = "1")
    private Long parentId = 0L;

    @Schema(description = "菜单图标", example = "dept")
    private String icon;

    @Schema(description = "排序号", example = "3")
    private Integer sort;
}
